package cn.jcet.module.sys.service.impl;

import cn.jcet.module.sys.domain.Permission;
import cn.jcet.module.sys.mapper.PermissionMapper;
import cn.jcet.module.sys.service.IPermissionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.io.Serializable;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 鲜磊
 * @since 2019-12-16
 */
@Service
public class PermissionServiceImpl extends ServiceImpl<PermissionMapper,Permission> implements IPermissionService {


    @Override
    public boolean removeById(Serializable id) {

        PermissionMapper permissionMapper = this.getBaseMapper();
        //根据权限id或者菜单id删除角色所有信息
        permissionMapper.deleteRolePermissionByPid(id);
        return super.removeById(id);//删除权限表的数据
    }
}
